import { defineStore } from "pinia";

export const useUserStore = defineStore({
    id: "user-store",
  state: () => ({
    token: uni.getStorageSync("token") || "",
    token1: uni.getStorageSync("token1") || "",
    token2: uni.getStorageSync("token2") || "",
    userInfo: uni.getStorageSync("userInfo") || {},
    userInfo1: uni.getStorageSync("userInfo1") ||{},
    userInfo2: uni.getStorageSync("userInfo2") ||{},
    sessionMsg: ''
  }),

  getters: {
  },
  actions: {
    SET_USERINFO(value) {
      this.userInfo = value;
    },
    SET_TOKEN(value) {
      this.token = value;
    },
    SET_TOKEN1(value) {
      this.token1 = value;
    },
    SET_TOKEN2(value) {
      this.token2 = value;
    },
    SET_USERINFO1(value) {
      this.userInfo1 = value;
    },
    SET_USERINFO2(value) {
        this.userInfo2 = value;
    },
    SET_SESSIONMSG(value) {
        this.sessionMsg = value;
    },
  },
});
